execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"]}] run data modify entity @s Item set value {id:"arrow",Count:1b}
execute as @e[type=marker,nbt={Tags:["wheat_minion"]}] at @s unless block ~ ~ ~ green_terracotta run kill @s
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"]}] at @s unless block ~ ~-1 ~ green_terracotta run kill @s

execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:0b}] at @s if block ~1 ~-1 ~-1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~1 ~-1 ~-1 run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:1b}] at @s if block ~1 ~-1 ~ wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~1 ~-1 ~ run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:2b}] at @s if block ~1 ~-1 ~1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~1 ~-1 ~1 run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:3b}] at @s if block ~0 ~-1 ~1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~0 ~-1 ~1 run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:4b}] at @s if block ~-1 ~-1 ~1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~-1 ~-1 ~1 run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:5b}] at @s if block ~-1 ~-1 ~ wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~-1 ~-1 ~ run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:6b}] at @s if block ~-1 ~-1 ~-1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~-1 ~-1 ~-1 run function advm:machines/wheat_minion_replant
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"],ItemRotation:7b}] at @s if block ~ ~-1 ~-1 wheat[age=7] if entity @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower] positioned ~ ~-1 ~-1 run function advm:machines/wheat_minion_replant

execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"]}] at @s run tp @e[type=item,distance=..5,nbt={Item:{id:"minecraft:wheat_seeds"}}] ~ ~2 ~
execute as @e[type=item_frame,nbt={Tags:["wheat_minion_selector"]}] at @s run tp @e[type=item,distance=..5,nbt={Item:{id:"minecraft:wheat"}}] ~ ~2 ~

